package com.c.ctgproject.ui.production

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.c.ctgproject.base.BaseViewModel
import com.c.ctgproject.http.ApiMethods
import com.c.ctgproject.utils.*

/**
 *作者:LiBW
 *创建日期: 2020/9/1
 *描述: 生产ViewModel
 */
class ProductionViewModel : BaseViewModel() {
    private val mMovingProduction = MutableLiveData<String>()
    val movingProduction: LiveData<String> get() = mMovingProduction

    fun movingProduction(version: String) {
        launch({
            MyLog.d("生产部门第一次扫二维码的token:${userToken}")
            mMovingProduction.value = ApiMethods.getApiService().movingProduction(userToken, version).awaitSync()
        }, {
            MyLog.d("生产部门第一次扫码错误回调:${it.message}")
            mError.value = it.message.handlerNull()
        })
    }
}


